import requests
import pytest
# 登录
# res = requests.post(url="http://60.205.190.66:8899/adminapi/login", json={"account":"admin","pwd":"123456","imgcode":"5"})
# print(res.json())




# class Test_qa():
#     @pytest.fixture(scope="function",autouse=True)
#     def setup(self,res):
#       res = requests.post(url="http://60.205.190.66:8899/adminapi/login", json={"account":"admin","pwd":"123456","imgcode":"5"})
# print(setup.json())
#     def teardown(self):


def login():
    res = requests.post(url="http://60.205.190.66:8899/adminapi/login",
                        json={"account": "admin", "pwd": "123456", "imgcode": "5"})
    return"Bearer"+res.json()['data']['token']
print(login())

# import requests
# import pytest
# class Testloginz():
#     @pytest.fixture(scope="function", autouse=True)
#     def setup_teardown(self):
#         res= requests.post("http://60.205.190.66:8899/adminapi/login",json={"account":"admin","pwd":"123456","imgcode":"2"})
#         self.token='Bearer'+ res.json()['data']['token']
#         assert res.status_code==200
#         assert res.json()['msg'] =='ok'
#         yield
#         print('登录成功')
#         print('退出登录')




